package com.kb5173.base.demo.original.hessian;

import java.net.MalformedURLException;

import com.caucho.hessian.client.HessianProxyFactory;
import com.kb5173.base.demo.protocal.DemoServiceApi;

public class HessianConsumer {

	public static void main(String[] args) {
		hessianToDubbo();
	}
	public static void hessianToDubbo(){
		HessianProxyFactory hpf = new HessianProxyFactory();
		try {
			DemoServiceApi dh = (DemoServiceApi) hpf.create(DemoServiceApi.class,
					"http://localhost:20883/" + DemoServiceApi.class.getName());

			long start = System.currentTimeMillis();
			for (int i = 0; i < 1000; i++) {
				System.out.println("======================" + i
						+ dh.demoServiceApi());
			}
			System.out.println((System.currentTimeMillis() - start) / 1000);
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
	}
	
}
